#include <stdio.h>

//https://www.nowcoder.com/practice/9a03096ed8ab449e9b10b0466de29eb2?tpId=290&tqId=2337396&ru=/exam/oj/ta&qru=/ta/beginner-programmers/question-ranking&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D290

void ChrisTree(int n) {
    for (int i = 0; i / 3 < n; i++) {            //叶子循环几行
        for (int j = 1; j < n - i / 3; j++) {    //每行的空格
            printf("   ");
        }
        for (int j = 0; j <= i / 3; j++) {       //打印树叶
            if (i % 3 == 0) {
                printf("  *   ");
            } else if((i - 1) % 3 == 0) {
                printf(" * *  ");
            } else if((i - 2) % 3 == 0) {
                printf("* * * ");
            }
        }
        printf("\n");
    }
    for (int i = 1; i <= n; i++) {                //木头循环几行
        for (int j = 1; j <= n; j++) {            //每行的打印格式
            if (j < n) {
                printf("   ");
            } else {
                printf("  *\n");
            }
        }
    }
}

int main() {
    int n = 0;
    scanf("%d", &n);
    ChrisTree(n);
    return 0;
}